/*
 * Matrix.h
 *
 *  Created on: Sep 22, 2012
 *      Author: HUNG
 */

#ifndef MATRIX_H_
#define MATRIX_H_

/*
 *
 */
class Matrix
{
    private:
        int row, col;   //hang, cot
        double **data;
    public:
        Matrix();
        virtual ~Matrix();
        Matrix(int _row, int _col);
        Matrix(int _row, int _col, double **A);
        Matrix(int _row, int _col, int isZezoOrIndentity);
        friend Matrix MatrixZezo(int _row, int _col);       //Matrix 0
        friend Matrix MatrixIndentity(int _row, int _col);  //Matrix Don vi
        Matrix operator+(const Matrix &MT);
        Matrix operator-(const Matrix &MT);
        Matrix operator*(const Matrix &MT);
        Matrix operator*(const double &a);
        Matrix transpose();             //Ma tran chuyen vi
        int getRow();
        int getCol();
        void setData(int i, int j, double _data);
        double getData(int i, int j);
        friend double det(Matrix &MT);      //Dinh thuc
        Matrix inverse();                   //Ma tran nghich dao
        void Input(char *);
        void Output();
};

double** InitArray(int _row, int _cow);
void swap(double &x, double &y);

#endif /* MATRIX_H_ */
